<?php
// 试卷-题目关联表 migration
use think\migration\Migrator;
use Phinx\Db\Adapter\MysqlAdapter;

class ExamPaperQuestion extends Migrator
{
    public function change()
    {
        $table = $this->table('exam_paper_question');
        $table->addColumn('paper_id', 'integer', ['default' => 0, 'comment' => '试卷ID'])
            ->addColumn('question_id', 'integer', ['default' => 0, 'comment' => '题目ID'])
            ->addColumn('sort', 'integer', ['default' => 0, 'comment' => '排序'])
            ->addColumn('type', 'string', ['limit' => 16, 'default' => '', 'comment' => '题型'])
            ->addColumn('score', 'integer', ['default' => 1, 'comment' => '分值'])
            ->create();
    }
}
